package cn.beyond.vehicleManagement.service;

import cn.beyond.vehicleManagement.dao.UserDao;
import cn.beyond.vehicleManagement.pojo.SysUser;

import java.util.List;
import java.util.Map;

/**
 *
 */
public class UserService {
     UserDao userDao=new UserDao();

    public int addUser(SysUser user){
        return    userDao.addUser(user);
    }

    /**
     * 删除用户
     * @param obj
     * @param column
     * @return
     */
    public int deleteUser(Object obj,String column){
        return userDao.deleteUser(obj,column);

    }

    /**
     * 修改用户
     * @param user
     * @return
     */
    public int update(SysUser user){
        return  userDao.update(user);
    }

    /**
     * 查询结果返回单条记录
     * @param user
     * @param selectmap
     * @return
     */
    public SysUser selectUserByOne(SysUser user, Map<String, Object> selectmap){
        return userDao.selectUserByOne(user,selectmap);
    }

    /**
     * 查询结果返回多条记录
     * @param user
     * @param selectmap
     * @return
     */
    public List<SysUser> selectUserByCondition(SysUser user, Map<String, Object> selectmap){
        return  userDao.selectAll(user,"sys_user",selectmap);
    }
}
